package com.ruoyi.emergency.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.ruoyi.common.utils.SnowflakeIdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.emergency.mapper.EpEscapeRouteConfigMapper;
import com.ruoyi.emergency.domain.EpEscapeRouteConfig;
import com.ruoyi.emergency.service.IEpEscapeRouteConfigService;

/**
 * 避灾路线配置Service业务层处理
 * 
 * @author hcc
 * @date 2024-11-26
 */
@Service
public class EpEscapeRouteConfigServiceImpl extends ServiceImpl<EpEscapeRouteConfigMapper, EpEscapeRouteConfig> implements IEpEscapeRouteConfigService //修改
{
    @Autowired
    private EpEscapeRouteConfigMapper epEscapeRouteConfigMapper;

    /**
     * 查询避灾路线配置
     * 
     * @param routeConfigId 避灾路线配置主键
     * @return 避灾路线配置
     */
    @Override
    public EpEscapeRouteConfig selectEpEscapeRouteConfigByRouteConfigId(String routeConfigId)
    {
        return epEscapeRouteConfigMapper.selectEpEscapeRouteConfigByRouteConfigId(routeConfigId);
    }

    /**
     * 查询避灾路线配置列表
     * 
     * @param epEscapeRouteConfig 避灾路线配置
     * @return 避灾路线配置
     */
    @Override
    public List<EpEscapeRouteConfig> selectEpEscapeRouteConfigList(EpEscapeRouteConfig epEscapeRouteConfig)
    {
        return epEscapeRouteConfigMapper.selectEpEscapeRouteConfigList(epEscapeRouteConfig);
    }

    /**
     * 新增避灾路线配置
     * 
     * @param epEscapeRouteConfig 避灾路线配置
     * @return 结果
     */
    @Override
    public int insertEpEscapeRouteConfig(EpEscapeRouteConfig epEscapeRouteConfig)
    {
        epEscapeRouteConfig.setRouteConfigId(String.valueOf(new SnowflakeIdUtils(5,8).nextId()));
        epEscapeRouteConfig.setRouteCode(String.valueOf(new SnowflakeIdUtils(5,8).nextId()));
        return epEscapeRouteConfigMapper.insertEpEscapeRouteConfig(epEscapeRouteConfig);
    }

    /**
     * 修改避灾路线配置
     * 
     * @param epEscapeRouteConfig 避灾路线配置
     * @return 结果
     */
    @Override
    public int updateEpEscapeRouteConfig(EpEscapeRouteConfig epEscapeRouteConfig)
    {
        return epEscapeRouteConfigMapper.updateEpEscapeRouteConfig(epEscapeRouteConfig);
    }

    /**
     * 批量删除避灾路线配置
     * 
     * @param routeConfigIds 需要删除的避灾路线配置主键
     * @return 结果
     */
    @Override
    public int deleteEpEscapeRouteConfigByRouteConfigIds(String[] routeConfigIds)
    {
        return epEscapeRouteConfigMapper.deleteEpEscapeRouteConfigByRouteConfigIds(routeConfigIds);
    }

    /**
     * 删除避灾路线配置信息
     * 
     * @param routeConfigId 避灾路线配置主键
     * @return 结果
     */
    @Override
    public int deleteEpEscapeRouteConfigByRouteConfigId(String routeConfigId)
    {
        return epEscapeRouteConfigMapper.deleteEpEscapeRouteConfigByRouteConfigId(routeConfigId);
    }
}
